import { $gc } from 'gc-starter-ui-plus'

export function getList(params = {}, flag = false) {
  return $gc.get(
    '/todo/',
    params,
    flag
  )
}

export function addTodo(data = {}, flag = false) {
  return $gc.post(
    '/todo',
    data,
    flag
  )
}

export function updateTodo(data = {}, flag = false) {
  return $gc.put(
    '/todo',
    data,
    flag
  )
}

export function delTodo(id, params = {}, flag = false) {
  return $gc.del(
    `/todo/${id}`,
    params,
    flag
  )
}

export function getTodoInfo(id, params = {}, flag = false) {
  return $gc.get(
    `/todo/${id}`,
    params,
    flag
  )
}

export function checkRepeat(params = {}, flag = false) {
  return $gc.post(
    `/todo/repeat`,
    params,
    flag
  )
}
